package com.hotelmanage.manage.services;

import com.hotelmanage.manage.entities.Student;
import com.hotelmanage.manage.mappers.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class StudentService {

    @Autowired
    StudentMapper studentMapper;

    public Student save(Student student)
    {
            return studentMapper.save(student);
    }

    public List<Student> getAll()
    {
            return studentMapper.findAll();
    }

    public Student findByStudentId(long theId)
    {
            return studentMapper.findByStudentId(theId);
    }

    public void delete(Student theStudent)
    {
            studentMapper.delete(theStudent);
    }


//    @Autowired
//    private StudentMapper studentMapper;
//
//    public int create(Student student) {
//        return  studentMapper.create(Student);
//    }
//
}
